package com.model.weather;

public enum Weather {
	Sunny("晴天"),Rainy("雨"),Cloudy("阴天"),Snowy("雪"),Calm("风平浪静");
	
	private final String weather;
	
	private Weather(String weather){
		this.weather = weather;
	}
	public String getWeatherName(){
		return this.weather;
	}
	
	public static Weather judgeWeather(int weatherCode){
		switch(weatherCode){
			case 31:
			case 32:
				return Sunny;
			case 3:
			case 4:
			case 5:
			case 6:
			case 7:
			case 8:
			case 9:
			case 10:
			case 11:
			case 12:
			case 18:
			case 35:
			case 37:
			case 38:
			case 39:
			case 40:
			case 42:
			case 45:
			case 47:
				return Rainy;
			case 26:
			case 27:
			case 28:
			case 29:
			case 30:
				return Cloudy;
			case 13:
			case 14:
			case 15:
			case 16:
			case 41:
			case 43:
			case 46:
				return Snowy;
			default:
				return Calm;
		}
	}
}
